package 补充.输入输出操作.字节流;

import java.io.FileOutputStream;
import java.io.IOException;

public class 字节流操作文件追加写入 {//用FileOutputStream的两个参数构造方法
    public static void main(String[] args) throws IOException {
        System.out.println("请输入要保存文件的内容");
        int count,n=512;
        byte[] b=new byte[n];
        count=System.in.read(b);
        FileOutputStream fos=new FileOutputStream("D:\\Learn\\javademo\\untitled\\src\\补充_偏\\输入输出操作\\read.txt",true);
        fos.write(b,0,count);
        System.out.println("已保存到read.txt");
        fos.close();
    }
}
